package com.ymatou.search;

import com.android.uiautomator.core.UiObject;
import com.android.uiautomator.core.UiObjectNotFoundException;
import com.android.uiautomator.core.UiSelector;
import com.android.uiautomator.testrunner.UiAutomatorTestCase;
import com.ymatou.util.Logger;

@SuppressWarnings("deprecation")
public class SeachEnterWordsTest extends UiAutomatorTestCase{
	
	private static final String TAG = SearchHotSuggestTest.class.getSimpleName();
	
	public static void testSeachEnterWords() throws UiObjectNotFoundException, InterruptedException {
		UiSelector eet_search_prepare_text_s = new UiSelector().resourceId("com.ymatou.shop:id/eet_search_prepare_text");
	    UiObject eet_search_prepare_text_o = new UiObject(eet_search_prepare_text_s);
	    
	    eet_search_prepare_text_o.setText("coach");
	    Logger.log(TAG, "输入搜索词coach");
	    
	    UiSelector tv_search_prepare_search_s = new UiSelector().resourceId("com.ymatou.shop:id/tv_search_prepare_search");
	    UiObject tv_search_prepare_search_o = new UiObject(tv_search_prepare_search_s);
	    
	    if (tv_search_prepare_search_o.waitForExists(5000)) {
	    	tv_search_prepare_search_o.click();
	    	//tv_search_prepare_search_o.click();
		    Logger.log(TAG, "点击搜索按钮");
	    }
	}
}
